<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: qupen
  Date: 2016/9/19
  Time: 14:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<header class="main-header" id="main-header">
    <!-- Logo -->
    <a class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <img class="logo-mini" src="/images/logo-mini.png">
        <!-- logo for regular state and mobile devices -->
        <div class="logo-lg-wrapper">
            <div class="logo-lg-container">
                <%--<img class="logo-lg" src="/api/v1/image/get?name=${userInfo.getLogoMd5()}">--%>
            </div>
        </div>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top" role="navigation">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button" style="border: none">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>

        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <!-- User Account: style can be found in dropdown.less -->
                <li class="dropdown user user-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="border: none">
                        <c:choose>
                            <c:when test="${sessionScope['siemens.multitenant.login.user'].getLogoMd5()==null||sessionScope['siemens.multitenant.login.user'].getLogoMd5()==''}">
                                <img src="/images/avatar.png" class="user-image" alt="User Image"/>
                            </c:when>
                            <c:otherwise>
                                <img src="/api/v1/image/get?name=${sessionScope['siemens.multitenant.login.user'].getLogoMd5()}"
                                     class="user-image" alt="User Image"/>
                            </c:otherwise>
                        </c:choose>
                        <span class="hidden-xs">${sessionScope['siemens.multitenant.login.user'].getUserName()}</span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-header">
                            <c:choose>
                                <c:when test="${sessionScope['siemens.multitenant.login.user'].getLogoMd5()==null||sessionScope['siemens.multitenant.login.user'].getLogoMd5()==''}">
                                    <img src="/images/avatar.png" class="user-image" alt="User Image"/>
                                </c:when>
                                <c:otherwise>
                                    <img src="/api/v1/image/get?name=${sessionScope['siemens.multitenant.login.user'].getLogoMd5()}"
                                         class="user-image" alt="User Image"/>
                                </c:otherwise>
                            </c:choose>
                            <p>
                                ${sessionScope['siemens.multitenant.login.user'].getUserName()}
                                - ${sessionScope['siemens.multitenant.login.user'].getTelephone()}
                                <small>${sessionScope['siemens.multitenant.login.user'].getCreateTime()}</small>
                            </p>
                        </li>
                        <!-- Menu Body -->
                        <li class="user-body">
                            <div class="row">
                                <div class="col-xs-6 text-center">
                                    <a style="border: none">${sessionScope['siemens.multitenant.login.user'].getDepartment()}</a>
                                </div>
                            </div>
                            <!-- /.row -->
                        </li>
                        <!-- Menu Footer-->
                        <%--<li class="user-footer">--%>
                        <%--<div class="pull-left">--%>
                        <%--<a href="#" class="btn btn-default btn-flat"><spring:message--%>
                        <%--code="label.admin.sidebar.dashboard.profile.set"/></a>--%>
                        <%--</div>--%>
                        <%--<div class="pull-right">--%>
                        <%--<a href="#" class="btn btn-default btn-flat"><spring:message--%>
                        <%--code="label.admin.sidebar.dashboard.profile.signOut"/></a>--%>
                        <%--</div>--%>
                        <%--</li>--%>
                    </ul>
                </li>
                <!-- Messages: style can be found in dropdown.less-->
                <%--<li class="dropdown messages-menu">--%>
                <%--<a href="#" class="dropdown-toggle" data-toggle="dropdown">--%>
                <%--<img class="logo-lg" src="/images/message.png">--%>
                <%--<span id="messageCount" class="label label-success"></span>--%>
                <%--</a>--%>
                <%--</li>--%>
                <!-- Control Sidebar Toggle Button -->
                <li>
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="border: none">
                        <img src="/images/language.png"/>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li>
                            <a href="javascript:;" onclick="chooseLanguage('en')"><spring:message code="label.english"/></a>
                            <a href="javascript:;" onclick="chooseLanguage('zh')"><spring:message code="label.chinese"/></a>
                        </li>
                    </ul>
                </li>
                <!-- logout -->
                <li>
                    <a href="/partner/${sessionScope['siemens.multitenant.login.user'].getTenant()}/logout"
                       style="border: none"> <img class="logo-lg" src="/images/quit_black.png"></a>
                </li>
            </ul>
        </div>
    </nav>
</header>
